<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>

<div align="center">
	Liste des moyens de paiement
	<html:form action="/typePaiementListe" method="post" onsubmit="return validateTypePaiementForm(this);">
		<table border="2">
			<tr>
				<td>Mode de paiement</td>
				<td>Acessible Client Classique</td>
				<td>Accessible Super Client</td>
			</tr>

			
			<c:forEach var="typePaiement" items="${listeTypePaiement}">

				<c:choose>
					<c:when test="${typePaiement.id == 2}">
						<tr>
							<td> 
								CB : 
								<input type="text" name="idCarteBancaire" size="3" maxlength="3" value="<c:out value="${typePaiement.id}"/>"/>
							</td>
							
						  	<td>
				  				<c:choose>
				  					<c:when test="${typePaiement.accessibleClient == false}">
				  						<input type="checkbox" name="accessibleClientCarteBancaire"/>
				  					</c:when>
				  					<c:when test="${typePaiement.accessibleClient == true}">
				  						<input type="checkbox" name="accessibleClientCarteBancaire" checked="checked"/>
				  					</c:when>
				  				</c:choose>
							</td>

							<td>
				  				<c:choose>
				  					<c:when test="${typePaiement.accessibleSuperClient == false}">
				  						<input type="checkbox" name="accessibleSuperClientCarteBancaire"/>
				  					</c:when>
				  					<c:when test="${typePaiement.accessibleSuperClient == true}">
				  						<input type="checkbox" name="accessibleSuperClientCarteBancaire" checked="checked"/>
				  					</c:when>
				  				</c:choose>
							</td>
						</tr>
					 </c:when>
					 <c:when test="${typePaiement.id == 3}">
						<tr>
							<td> 
								PayPal : 
								<input type="hidden" name="idPayPal" size="3" maxlength="3" value="<c:out value="${typePaiement.id}"/>"/>
							</td>
							<td>
				  				<c:choose>
				  					<c:when test="${typePaiement.accessibleClient == false}">
				  						<input type="checkbox" name="accessibleClientPayPal"/>
				  					</c:when>
				  					<c:when test="${typePaiement.accessibleClient == true}">
				  						<input type="checkbox" name="accessibleClientPayPal" checked="checked"/>
				  					</c:when>
				  				</c:choose>
							</td>
							
							<td>
				  				<c:choose>
				  					<c:when test="${typePaiement.accessibleSuperClient == false}">
				  						<input type="checkbox" name="accessibleSuperClientPayPal"/>
				  					</c:when>
				  					<c:when test="${typePaiement.accessibleSuperClient == true}">
				  						<input type="checkbox" name="accessibleSuperClientPayPal" checked="checked"/>
				  					</c:when>
				  				</c:choose>
							</td>

						</tr>
					 </c:when>
					 <c:when test="${typePaiement.id == 4}">
						<tr>
							<td> 
								Cheque : 
								<input type="hidden" name="idCheque" size="3" maxlength="3" value="<c:out value="${typePaiement.id}"/>"/>
							</td>
							<td>
				  				<c:choose>
				  					<c:when test="${typePaiement.accessibleClient == false}">
				  						<input type="checkbox" name="accessibleClientCheque"/>
				  					</c:when>
				  					<c:when test="${typePaiement.accessibleClient == true}">
				  						<input type="checkbox" name="accessibleClientCheque" checked="checked"/>
				  					</c:when>
				  				</c:choose>
							</td>
							
							<td>
				  				<c:choose>
				  					<c:when test="${typePaiement.accessibleSuperClient == false}">
				  						<input type="checkbox" name="accessibleSuperClientCheque"/>
				  					</c:when>
				  					<c:when test="${typePaiement.accessibleSuperClient == true}">
				  						<input type="checkbox" name="accessibleSuperClientCheque" checked="checked"/>
				  					</c:when>
				  				</c:choose>
							</td>
						</tr>
					 </c:when>
					 <c:when test="${typePaiement.id == 5}">
						<tr>
							<td> 
								Contre remboursement :
								<input type="hidden" name="idContreRemboursement" size="3" maxlength="3" value="<c:out value="${typePaiement.id}"/>"/>
							</td>
							
							<td>
				  				<c:choose>
				  					<c:when test="${typePaiement.accessibleClient == false}">
				  						<input type="checkbox" name="accessibleClientContreRemboursement"/>
				  					</c:when>
				  					<c:when test="${typePaiement.accessibleClient == true}">
				  						<input type="checkbox" name="accessibleClientContreRemboursement" checked="checked"/>
				  					</c:when>
				  				</c:choose>
							</td>

							<td>
				  				<c:choose>
				  					<c:when test="${typePaiement.accessibleSuperClient == false}">
				  						<input type="checkbox" name="accessibleSuperClientContreRemboursement"/>
				  					</c:when>
				  					<c:when test="${typePaiement.accessibleSuperClient == true}">
				  						<input type="checkbox" name="accessibleSuperClientContreRemboursement" checked="checked"/>
				  					</c:when>
				  				</c:choose>
							</td>
						</tr>
					 </c:when>
				</c:choose>
			</c:forEach>

			<tr style="text-align : center">
				<td colspan="3" height="100">
					<input type="submit" value="Valider" />
				</td>
			</tr>
		</table>
		<html:javascript formName="TypePaiementForm" />
	</html:form>
	
</div>
